<!DOCTYPE html>
<style id="styleElement">@media all { } </style>
<script>
    if (window.testRunner)
        testRunner.dumpAsText();

    var s = document.getElementById("styleElement");
    document.head.appendChild(s.cloneNode(true));
    s.sheet.cssRules[0].insertRule("div { }", 0);
</script>
<p>This test should not crash/assert.</p>
